//package com.thinksns.sociax.t4.android.fragment;
//
//import android.graphics.drawable.ColorDrawable;
//import android.os.Bundle;
//import android.util.Log;
//import android.view.View;
//import android.widget.AdapterView;
//import android.widget.ListView;
//import android.widget.Toast;
//
//import com.scwang.smartrefresh.layout.SmartRefreshLayout;
//import com.scwang.smartrefresh.layout.api.RefreshLayout;
//import com.scwang.smartrefresh.layout.listener.OnLoadmoreListener;
//import com.scwang.smartrefresh.layout.listener.OnRefreshListener;
//import com.thinksns.sociax.android.R;
//import com.thinksns.sociax.t4.adapter.AdapterSociaxList;
//import com.thinksns.sociax.t4.android.weiba.ActivityPostDetail;
//import com.thinksns.sociax.t4.model.ModelPost;
//import com.thinksns.sociax.thinksnsbase.activity.widget.EmptyLayout;
//import com.thinksns.sociax.thinksnsbase.bean.ListData;
//import com.thinksns.sociax.thinksnsbase.bean.SociaxItem;
//import com.thinksns.sociax.thinksnsbase.utils.ActivityStack;
//
///**
// * 类说明：
// *
// * @author Administrator
// * @version 1.0
// * @date 2015-1-4
// */
//public class FragmentPostHot extends FragmentPostList implements AdapterView.OnItemClickListener, OnRefreshListener,OnLoadmoreListener {
//    private int weiba_id = -1;
//    private SmartRefreshLayout smartRefreshLayout;
////    private EmptyLayout emptyLayout;
//
//    @Override
//    public void initView() {
//        smartRefreshLayout = (SmartRefreshLayout) findViewById(R.id.smart_refresh_layout);
//        listView = (ListView) findViewById(R.id.pull_refresh_list);
//        listView.setBackgroundColor(getResources().getColor(R.color.bg_ios));
//        listView.setDivider(new ColorDrawable(getResources().getColor(R.color.bg_listview_divider)));
//        listView.setDividerHeight(1);
//        listView.setSelector(R.drawable.list_selector);
//
////        emptyLayout = (EmptyLayout) findViewById(R.id.empty_layout);
////        emptyLayout.setNoDataContent(getResources().getString(R.string.empty_content));
//
//        list = new ListData<SociaxItem>();
//        adapter = new AdapterPostHotList(this, list);
//        listView.setAdapter(adapter);
//        listView.setOnItemClickListener(this);
//    }
//
//    @Override
//    public void initIntentData() {
//        weiba_id = getActivity().getIntent().getIntExtra("weiba_id", -1);
//        if (weiba_id == -1) {
//            Log.e("FragmentPostDigest", "FragmentWeibaDigest needs intent weiba_id");
//        }
//    }
//
//    @Override
//    public void initListener() {
//        smartRefreshLayout.setOnRefreshListener(this);
//        smartRefreshLayout.setOnLoadmoreListener(this);
////        emptyLayout.setOnLayoutClickListener(new View.OnClickListener() {
////            @Override
////            public void onClick(View v) {
////
////            }
////        });
//    }
//
//    @Override
//    public EmptyLayout getEmptyLayout() {
//        return null;
//    }
//
//    @Override
//    public void initData() {
//        adapter.loadInitData();
//    }
//
//    @Override
//    public int getLayoutId() {
//        return R.layout.fragment_common_post_list;
//    }
//
//    @Override
//    public void executeDataSuccess(ListData<SociaxItem> list) {
////        emptyLayout.setErrorType(EmptyLayout.HIDE_LAYOUT);
//        if (list.size() < AdapterSociaxList.PAGE_COUNT) {
//            if (adapter.getLast() != null) {
//                smartRefreshLayout.setEnableLoadmore(false);
//                Toast.makeText(getActivity(),getString(R.string.loading_no_more), Toast.LENGTH_SHORT).show();
//            }
//        } else {
//
//        }
//        super.executeDataSuccess(list);
//    }
//
//    @Override
//    public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
//        if (id < 0){
//            return;
//        }
//        ModelPost post = (ModelPost) adapter.getItem((int) id);
//        if (post != null && post.getUser() != null) {
//            Bundle data = new Bundle();
//            data.putParcelable("post", post);
//            ActivityStack.startActivity(getActivity(), ActivityPostDetail.class, data);
//        }
//    }
//
//    @Override
//    public void onLoadmore(RefreshLayout refreshlayout) {
//        if (adapter != null) {
//            adapter.doRefreshFooter();
//        }
//    }
//
//    @Override
//    public void onRefresh(RefreshLayout refreshlayout) {
//        if (adapter != null) {
//            adapter.doRefreshHeader();
//        }
//    }
//}
